package day3;

import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class ListSchoolTest {
    public static void main(String[] args) {
        List list=new ArrayList();
        list.add(new School("合肥科海","合肥",7,4));
        list.add(new School("杭州西湖中兴","杭州",5,4));
        list.add(new School("南京中博","南京",27,14));
        list.add(new School("蚌埠原石","蚌埠",9,9));
        for (Object o:list) {
            School s= (School) o;
            System.out.println(s.getName());
        }
        System.out.println(">>>>>>>>>>>>>>>>>>>>");
        School sh=new School("蚌埠原石","阜阳",4,4);
        System.out.println("在不在？"+list.contains(sh));
        System.out.println("位置："+list.indexOf(sh));
        //list.get(3);
        boolean remove = list.remove(sh);
        System.out.println("sh删除乐？"+remove);
        System.out.println("删除后：");
        System.out.println(list);
    }
}
